﻿@import url("../main-colors.css");

/* ظرف اصلی محصولات - گرید responsive */
.products {
    display: grid;
    grid-template-columns: 1fr; /* موبایل: ۱ ستون */
    gap: 25px;
    margin-top: 20px;
    padding: 0 15px;
}

@media (min-width: 768px) {
    .products {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 20px;
    }
}

@media (min-width: 1024px) {
    .products {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .products {
        grid-template-columns: repeat(4, 1fr);
        padding: 0;
    }
}

/* کارت محصول */
.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

    .product-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    }

    .product-card a {
        text-decoration: none;
        color: inherit;
        display: flex;
        flex-direction: column;
        flex-grow: 1;
        padding: 15px;
    }

/* تصویر محصول */
.offer-img {
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
}

    .offer-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

.product-card:hover .offer-img img {
    transform: scale(1.05);
}

/* عنوان محصول - مهم‌ترین بخش اصلاح‌شده */
.product-countent-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.5;
    margin: 12px 0 8px;
    color: #333;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    /* موبایل: تا ۳ خط */
    -webkit-line-clamp: 3;
    /* تبلت و دسکتاپ: حداکثر ۲ خط */
    @media (min-width: 768px) {
        -webkit-line-clamp: 2;
    }
}

/* اطلاعات بالا */
.product-info-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.product-stock {
    color: #28a745;
    font-weight: 600;
}

.product-brand {
    color: #007bff;
    font-weight: 600;
}

/* اطلاعات وسط */
.product-info-middle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.8rem;
    color: #666;
}

.product-category, .product-color {
    padding: 2px 6px;
    background: #f8f9fa;
    border-radius: 4px;
}

/* قیمت و تخفیف */
.product-info-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    flex-wrap: wrap;
    gap: 8px;
    flex-grow: 1;
    align-items: flex-end;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #007bff;
    order: 3;
}

.product-old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.95rem;
    order: 2;
}

.product-discount {
    background: #dc3545;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    order: 1;
}

/* گارانتی */
.product-warranty {
    text-align: center;
    margin-top: auto; /* فشار به پایین کارت */
    padding-top: 10px;
    color: #6c757d;
    font-size: 0.75rem;
    border-top: 1px solid #eee;
}

/* برچسب‌های تخفیف و پیشنهاد ویژه */
.offer-discount, .offer-special {
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 2;
}

    .offer-discount span {
        background-color: #dc3545;
        color: white;
        padding: 8px 12px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 600;
        box-shadow: 0 2px 6px rgba(220,53,69,0.4);
    }

    .offer-special span {
        background-color: #ffc107;
        color: #212529;
        padding: 8px 12px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 600;
        box-shadow: 0 2px 6px rgba(255,193,7,0.4);
    }
